<?php
/**
 * Created by PhpStorm.
 * User: qttx
 * Date: 2019/5/30
 * Time: 13:56
 */
namespace app\admin\controller;

use app\admin\model\BuyorderModel;

class Buyorder extends BaseController
{
    public function __construct()
    {
        parent::__construct();
        $this->buyorder = new BuyorderModel();
    }
     /**买单首页*/
    public function mumberbuy_index()
    {
        $list = $this->buyorder->mumberbuy_index();
        $page = $list->render();
        $count = count($list);
        $this->assign('list',$list);
        $this->assign('page',$page);
        $this->assign('count',$count);
        $this->assign('num','1');
        return view('buyorder/index');
    }

    /**卖单首页*/
    public function mumbersell_index()
    {
        $list = $this->buyorder->mumbersell_index();
        $page = $list->render();
        $count = count($list);
        $this->assign('list',$list);
        $this->assign('page',$page);
        $this->assign('count',$count);
        $this->assign('num','0');
        return view('buyorder/index');
    }
    /**申诉首页*/
    public function appeal()
    {
        $list = $this->buyorder->appeal();
        $page = $list->render();
        $count = count($list);
        $this->assign('list',$list);
        $this->assign('page',$page);
        $this->assign('count',$count);
        $this->assign('num','2');
        return view('buyorder/index');
    }
    /**详情*/
    public function buy_list()
    {
        $id = input('id');
        $res = $this->buyorder->buy_list($id);
        $this->assign('data',$res);
        return view('buyorder/list');
    }
    /**修改为已处理*/
    public function order_update()
    {
        $date['id'] = request()->post('id');
        $upd['status'] = 4;
        $update = $this->buyorder->order_update($date,$upd);
        if($update)
        {
            return true;
        }else{
            return false;
        }
    }
}